<div class="table-responsive">
    <table class="list table table-bordered table-striped">
        <thead>
        <tr>
            <th>
                @component('backend::component.checkbox')
                    @slot('name') ids-all @endslot
                @endcomponent
            </th>
            <th><i class="hcl hcl-youjian mr-1"></i>留言标题</th><th>留言人</th><th>留言信息</th><th>留言时间</th><th>操作</th>
        </tr>
        </thead>
        <tbody>
        @foreach($list as $value)
            <tr>
                <td>
                    @component('backend::component.checkbox')
                        @slot('name') id[] @endslot
                        @slot('class') id @endslot
                        @slot('value') {{$value->id}} @endslot
                    @endcomponent
                </td>
                <td>
                    <i class="hcl {{$value->is_read == 0?'hcl-youjian':'hcl-msg-read'}} mr-1"></i>
                    {{$value->title}}
                </td>
                <td>
                    @if($value->fromUser)
                        {{$value->fromUser->user_number}}
                        [{{$value->fromUser->real_name}}]
                    @else
                        自己
                    @endif
                </td>
                <td class="text-truncate" style="max-width: 8rem;">
                    <a href="{{route('b_Message_detail',['id'=>$value->id])}}" title="查看详情">{{$value->content}}</a>
                </td>
                <td class="">{{$value->created_at}}</td>
                <td>
                    @if(!$value->is_reply)
                        @component('backend::component.form.button')
                            @slot('title') 回复 @endslot
                            @slot('elem') a @endslot
                            @slot('icon') hcl-msg @endslot
                            @slot('color') info @endslot
                            @slot('size') xs @endslot
                            @slot('href') {{route('b_Message_reply',['id'=>$value->id])}} @endslot
                        @endcomponent
                         @if(!$value->is_read)
                            @component('backend::component.form.button')
                                @slot('title') 标记已读 @endslot
                                @slot('icon') hcl-mark-read @endslot
                                @slot('color') primary @endslot
                                @slot('size') xs @endslot
                                @slot('params') {"url":"{{route('b_Message_markedRead',['id'=>$value->id])}}","confirm":"true"} @endslot
                                @slot('class') btn-ajax @endslot
                            @endcomponent
                         @endif
                    @endif
                    @component('backend::component.form.button')
                        @slot('title') 删除 @endslot
                        @slot('icon') hcl-delete @endslot
                        @slot('color') danger @endslot
                        @slot('size') xs @endslot
                    @endcomponent

                </td>
            </tr>
        @endforeach
        </tbody>
    </table>
</div>